package com.duobaoyu.dby.supply.biz.client.resource;

import com.duobaoyu.dby.channel.adapter.bean.logistics.LogisticsTrackInfo;
import com.duobaoyu.dby.supply.biz.client.resource.bean.bo.*;
import com.duobaoyu.dby.supply.biz.client.resource.bean.dto.AreaCityInfoDTO;
import com.duobaoyu.dby.supply.biz.client.resource.bean.dto.AreaInfoDTO;
import com.duobaoyu.dby.supply.biz.client.resource.bean.dto.ChannelRuleDTO;
import com.duobaoyu.dby.supply.biz.client.resource.bean.dto.StateInfoDTO;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @author liyang
 * @version 1.0.0
 * @ClassName ResourceService
 * @createTime 10:37:00 2023/09/26
 */
public interface ResourceApiClient {

	/**
	 * 获取渠道售后配置
	 *
	 * @param channelCode
	 * @return
	 */
	AfterSaleSettingConfigBO queryAfterSaleSettingConfig(String channelCode);

	/**
	 * 获取渠道审核策略配置
	 *
	 * @param channelCode
	 * @return
	 */
	AuditStrategyConfigBO queryAuditStrategyConfig(String channelCode);

	/**
	 * 获取渠道订单规则配置
	 *
	 * @param channelCode
	 * @return
	 */
	OrderRuleConfigBO queryOrderRuleConfig(String channelCode);

	/**
	 * 获取渠道预估运费配置
	 *
	 * @param channelCode
	 * @return
	 */
	PrefreightConfigBO queryPrefreightConfig(String channelCode);

	/**
	 * 根据售后类型获取售后原因
	 *
	 * @param afterSaleTypes
	 * @return
	 */
	List<AfterSaleReasonBO> queryAfterSaleReasons(List<Integer> afterSaleTypes);

	/**
	 * 根据售后类型获取售后原因
	 *
	 * @param afterSaleTypes
	 * @return
	 */
	Map<Integer, List<AfterSaleReasonBO>> queryAfterSaleReason(List<Integer> afterSaleTypes);

	/**
	 * 获取渠道地址
	 *
	 * @param areaInfo
	 * @return
	 */
	AreaInfoBO getChannelAddress(AreaInfoDTO areaInfo);

	/**
	 * 获取城市渠道地址
	 *
	 * @param areaCityInfo
	 * @return
	 */
	AreaCityInfoBO getChannelCityAddress(AreaCityInfoDTO areaCityInfo);

	/**
	 * 刷地址匹配度
	 *
	 * @param channelCode
	 * @param similarity
	 */
	void addressBindSimilarity(String channelCode, Integer similarity);

	/**
	 * 获取渠道对接配置
	 *
	 * @param channelCode
	 * @return
	 */
	ChannelConfigBO channelConfig(String channelCode);

	/**
	 * 获取本地异常规则
	 *
	 * @param channelRule
	 * @return
	 */
	ChannelRuleBO toLocalExceptionRule(ChannelRuleDTO channelRule);

	/**
	 * 根据字典编号获取字典配置
	 *
	 * @param dictionaryCode
	 * @return
	 */
	List<DictionaryConfigBO> dictionaryByCode(String dictionaryCode);

	/**
	 * 获取渠道状态映射
	 *
	 * @param stateInfo
	 * @return
	 */
	StateInfoBO getStateInfo(StateInfoDTO stateInfo);

	/**
	 * 状态信息
	 *
	 * @param stateCode
	 * @param label
	 * @param ifDeprecated
	 * @return
	 */
	List<MappingBO> getState(String stateCode, String label, Boolean ifDeprecated);

	/**
	 * 根据BizCode获取配置信息
	 *
	 * @param bizCode
	 * @return
	 */
	BusinessConfigBO getBizCodeInfo(String bizCode);

	/**
	 * 物流轨迹查询
	 */
	Map<String, ExpressInfoBO> getExpressInfoAllCacheByChannelCode(String channelCode);

	/**
	 * 获取物流轨迹
	 *
	 * @param logisticsNo 物流单号
	 * @param expressCompanyCode 渠道code
	 * @param phone 手机号
	 * @return LogisticsTrackInfo LogisticsTrackInfo
	 */
	LogisticsTrackInfo getLogisticsTrack(String logisticsNo, String expressCompanyCode, String phone);

	/**
	 * 校验是否为大额订单
	 *
	 * @param orderAmount 订单金额
	 * @return Boolean true 是大额订单 false 不是大额订单
	 */
	Boolean largeOrderCheck(BigDecimal orderAmount);
}
